import { version1, userLoginApi, userForgetApi } from '../src/api';

export default {
  [`POST ${version1}${userLoginApi}`]: (req: any, res: any) => {
    const { password, account, code } = req.body;
    if (password && account && code) {
      setTimeout(() => {
        res.send({
          data: {
            id: '59b5024db0f8b429bfdcc920',
            account: 'test@topvdn.com',
            status: 1,
            token:
              'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ',
          },
          message: '登录成功',
          request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
        });
      }, 1000);
    } else {
      res.status(400).send({
        data: {},
        message: '参数错误',
        request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
      });
    }
  },

  [`POST ${version1}${userForgetApi}`]: (req: any, res: any) => {
    const { email } = req.body;
    if (email) {
      setTimeout(() => {
        res.send({
          data: {},
          message: '邮件已发送，请检查邮件！',
          request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
        });
      }, 1000);
    } else {
      setTimeout(() => {
        res.status(400).send({
          data: {},
          message: '参数错误',
          request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
        });
      }, 1000);
    }
  },
};
